home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / Soundtracker Soundsystem.adf / sources / fxplayer.asm < prev    next >
Assembly Source File  |  1988-03-09  |  13KB  |  679 lines

  1. ****************************************************************************
  2. *                                       *    
  3. *                                       *
  4. *          Sound Abspiel Routine zu Sound FX                  *
  5. *                                       *
  6. *               © 1988 LINEL Switzerland                   *    
  7. *                                       *    
  8. *                 Aztec Version                   *    
  9. *                                       *
  10. ****************************************************************************
  11.     
  12.     CSEG
  13.  
  14.     Public    _LoadSound,_StopSound,_StartSound,_RemSound
  15.  
  16. _LoadSound:
  17.     movem.l    d0-d7/a0-a6,-(SP)
  18.     move.l    4,a6            ;ExcBase
  19.     lea    DosLib,a1        ;'dos.library'
  20.     jsr    -408(A6)        ;OldOpenLibrary()
  21.     move.l    d0,DosBase
  22.     move.l    #FileName,d0        ;'sound.data'
  23.     bsr    CheckFile        
  24.     move.l    d0,SongLaenge
  25.     tst.l    d0
  26.     beq.s    EndLoadSound
  27.     move.l    4,a6
  28.     moveq    #2,d1
  29.     jsr    -198(A6)
  30.     move.l    d0,SongPointer
  31.     tst.l    d0
  32.     beq.s    EndLoadSound
  33.     move.l    DosBase,a6
  34.     move.l    #FileName,d1
  35.     move.l    #1005,d2
  36.     jsr    -30(A6)
  37.     move.l    d0,d7
  38.     move.l    d0,d1
  39.     move.l    SongPointer,d2
  40.     move.l    SongLaenge,d3
  41.     jsr    -42(A6)
  42.     move.l    d7,d1
  43.     jsr    -36(A6)
  44.     move.l    a6,a1
  45.     move.l    4,a6
  46.     jsr    -414(a6)
  47. EndLoadSound:
  48.     movem.l    (SP)+,d0-d7/a0-a6
  49.     rts
  50.  
  51. CheckFile:
  52.     movem.l    d1-d7/a0-a6,-(A7)
  53.     move.l    d0,d6
  54.     moveq    #0,d7
  55.     
  56.     move.l    4,a6
  57.     move.l    #1024,d0
  58.     moveq    #0,d1
  59.     jsr    -198(A6)
  60.     move.l    d0,FileInfo
  61.     move.l    DosBase,a6
  62.     tst.l    d0
  63.     beq    EndCheckFile
  64.     
  65.     move.l    d6,d1
  66.     move.l    #$3ed,d2
  67.     jsr    -84(A6)
  68.     tst.l    d0
  69.     beq    EndCheckFile
  70.     move.l    d0,d1
  71.     move.l    d0,Lock
  72.     move.l    FileInfo,d2
  73.     jsr    -102(a6)
  74.     move.l    FileInfo,a0
  75.     move.l    124(A0),d7
  76.     move.l    Lock,d1
  77.     jsr    -90(A6)
  78. EndCheckFile:
  79.     clr.l    Lock
  80.     move.l    4,a6
  81.     move.l    FileInfo,a1
  82.     move.l    #1024,d0
  83.     jsr    -210(A6)
  84.     move.l    d7,d0
  85.     movem.l    (A7)+,d1-d7/a0-a6
  86.     rts
  87.  
  88.  
  89. _StartSound:
  90.     movem.l    d1-d7/a0-a6,-(SP)
  91.     move.l    4,a6            ;ExecBase
  92.     move.l    SongPointer,a0    ;Zeiger auf SongDaten
  93.     add    #60,a0            ;Laengentabelle ueberspringen
  94.     move.b    470(a0),AnzPat+1    ;Laenge des Sounds
  95.     move    4(A0),DelayValue     ;Geschwindigkeit
  96.     bsr    SongLen            ;Länge der Songdaten berechnen
  97.     add.l    d0,a0            ;Zur Adresse der Songstr.
  98.     add.w    #600,a0            ;Laenge der SongStr.
  99.     move.l    SongPointer,a2
  100.     lea    Instruments,a1        ;Tabelle auf Samples
  101.     moveq    #14,d7            ;15 Instrumente
  102. CalcIns:
  103.     move.l    a0,(A1)+        ;Startadresse des Instr.
  104.     add.l    (a2)+,a0        ;berechnen un speichern
  105.     dbf    d7,CalcIns
  106.  
  107.     lea    CiaaResource,a1        ;'ciaa.resource'
  108.     moveq    #0,d0            ;Version egal
  109.     jsr    -498(A6)        ;OpenResource()
  110.     move.l    d0,CiaaBase        ;Resource Base speichern
  111.     move.l    d0,a6
  112.     bsr    PlayDisable        ;Sound DMA abschalten
  113.     lea    Interrupt,a1        ;Sound Interupt Structure
  114.     moveq    #0,d0            ;TimerA
  115.     jsr    -6(A6)            ;installieren
  116.     move.l    d0,d5            ;ergebnis speichern
  117.     bsr    PlayInit        ;Loop Bereich setzen
  118.     bsr    PlayEnable        ;Player erlauben
  119.     bsr    InitTimer        ;Timer starten
  120.     moveq    #0,d0            ;Ergebnisregister loeschen
  121. EndStart:
  122.     tst.l    d5            ;ergebnis von Resource
  123.     sne    d0            ;ergebnis in d0 setzen 
  124.     movem.l    (SP)+,d1-d7/a0-a6
  125.     rts
  126.  
  127. ;---------------------------------------------------------------------------
  128.  
  129. _StopSound:
  130.     movem.l    d1-d7/a0-a6,-(SP)
  131.     move.l    CiaaBase,a6        ;Zeiger auf Ciaa Resource
  132.     lea    Interrupt,a1        ;Zeiger auf Int. Strukture
  133.     moveq    #0,d0            ;Timer A
  134.     jsr    -12(A6)            ;Interupt entfernen
  135.     bsr    PlayDisable        ;Player sperren
  136.     moveq    #0,d0            ;Alles Ok    
  137.     movem.l    (SP)+,d1-d7/a0-a6
  138.     rts
  139. ;---------------------------------------------------------------------------
  140.  
  141. _RemSound:
  142.     movem.l    d0-d7/a0-a6,-(SP)
  143.     move.l    4,a6
  144.     move.l    SongPointer,a1
  145.     move.l    SongLaenge,d0
  146.     beq.s    EndRemSound
  147.     jsr    -210(A6)
  148. EndRemSound:
  149.     movem.l    (SP)+,d0-d7/a0-a6
  150.     rts
  151. ;------------------------------------------------------------------------
  152.  
  153. SongLen:
  154.     movem.l    d1-d7/a0-a6,-(SP)
  155.     move.l    SongPointer,a0
  156.     lea    532(A0),a0
  157.     move    AnzPat,d2        ;wieviel Positions
  158.     subq    #1,d2            ;für dbf
  159.     moveq    #0,d1
  160.     moveq    #0,d0
  161. SongLenLoop:
  162.     move.b    (a0)+,d0        ;Patternnummer holen
  163.     cmp.b    d0,d1            ;ist es die höchste ?
  164.     bhi.s    LenHigher        ;nein!
  165.     move.b    d0,d1            ;ja
  166. LenHigher:
  167.     dbf    d2,SongLenLoop
  168.     move.l    d1,d0            ;Hoechste BlockNummer nach d0
  169.     addq    #1,d0            ;plus 1
  170.     mulu    #1024,d0        ;Laenge eines Block
  171.     movem.l    (SP)+,d1-d7/a0-a6
  172.     rts
  173.  
  174. ;--------------------------------------------------------------------    
  175.     DSEG
  176.  
  177. Interrupt:
  178.     dc.l    0            ;letzter Node
  179.     dc.l    0            ;nächster Node
  180.     dc.b    2            ;Node Type = Interrupt
  181.     dc.b    0             ;Priorität
  182.     dc.l    InterruptName        ;Name
  183.     dc.l    0            ;Zeiger auf Daten
  184.     dc.l    IntCode            ;Interrupt Routine
  185.  
  186. ;-------------------------------------------------------------------
  187.     CSEG
  188.  
  189. InitTimer:
  190.     move.b    #%10000001,$bfee01    ;Timer starten
  191.     lea    DelayValue,a1
  192.     move.b    1(a1),$bfe401        ;Timer A low
  193.     move.b    0(a1),$bfe501        ;Timer A high
  194.     rts
  195.  
  196. ;--------------------------------------------------------------------
  197.  
  198. PlayInit:
  199.     lea    Instruments,a0            ;Zeiger auf instr.Tabelle
  200.     moveq    #14,d7                ;15 Instrumente
  201. InitLoop:    
  202.     move.l    (A0)+,a1            ;Zeiger holen
  203.     clr.l    (A1)                ;erstes Longword löschen
  204.     dbf    d7,InitLoop
  205.     rts
  206.  
  207. ;-----------------------------------------------------------------------
  208.  
  209. PlayEnable:
  210.     lea    $dff000,a0        ;AMIGA
  211.     move.w    #-1,PlayLock        ;player zulassen
  212.     clr    $a8(A0)            ;Alle Voloumenregs. auf 0
  213.     clr    $b8(A0)
  214.     clr    $c8(a0)
  215.     clr    $d8(a0)
  216.     clr.w    Timer            ;zahler auf 0
  217.     clr.l    TrackPos        ;zeiger auf pos
  218.     clr.l    PosCounter        ;zeiger innehalb des pattern
  219.     rts
  220. ;----------------------------------------------------------------------
  221.  
  222. PlayDisable:
  223.     lea    $dff000,a0        ;AMIGA
  224.     clr.w    PlayLock        ;player sperren
  225.     clr    $a8(a0)            ;volumen auf 0
  226.     clr    $b8(a0)
  227.     clr    $c8(a0)
  228.     clr    $d8(a0)
  229.     move.w    #$f,$96(A0)        ;dma sperren
  230.     rts
  231.  
  232. ;---------------------------------------------------------------------
  233.  
  234. IntCode:
  235.     bsr    PlaySong        ;Note spielen
  236.     moveq    #0,d0            ;kein Fehler
  237.     rts
  238.  
  239. ;----------------------------------------------------------------------
  240.  
  241.  
  242. ;hier werden 5 * effekte gespielt und einmal der song
  243.  
  244. PlaySong:                ;HauptAbspielRoutine
  245.     movem.l    d0-d7/a0-a6,-(SP)
  246.     addq.w    #1,Timer        ;zähler erhöhen
  247.     cmp.w    #6,Timer        ;schon 6?
  248.     bne.s    CheckEffects        ;wenn nicht -> effekte
  249.     clr.w    Timer            ;sonst zähler löschen
  250.     bsr     PlaySound        ;und sound spielen
  251. NoPlay:    movem.l    (SP)+,d0-d7/a0-a6
  252.     rts
  253.  
  254. ;-------------------------------------------------------------------
  255.  
  256. CheckEffects:
  257.     moveq    #3,d7            ;4 kanäle
  258.     lea    StepControl0,a4
  259.     lea    ChannelData0,a6        ;zeiger auf daten für 0
  260.     lea    $dff0a0,a5        ;Kanal 0
  261. EffLoop:
  262.     movem.l    d7/a5,-(SP)
  263.     bsr.s    MakeEffekts        ;Effekt spielen
  264.     movem.l    (Sp)+,d7/a5
  265. NoEff:
  266.     add    #8,a4
  267.     add    #$10,a5            ;nächster Kanal
  268.     add    #22,a6            ;Nächste KanalDaten
  269.     dbf    d7,EffLoop
  270.     movem.l    (a7)+,d0-d7/a0-a6
  271.     rts
  272.  
  273. MakeEffekts:
  274.     move    (A4),d0
  275.     beq.s    NoStep
  276.     bmi.s    StepItUp
  277.     add    d0,2(A4)
  278.     move    2(A4),d0
  279.     move    4(A4),d1
  280.     cmp    d0,d1
  281.     bhi.s    StepOk
  282.     move    d1,d0
  283. StepOk:
  284.     move    d0,6(a5)
  285.     MOVE    D0,2(A4)
  286.     rts
  287.  
  288. StepItUp:
  289.     add    d0,2(A4)
  290.     move    2(A4),d0
  291.     move    4(A4),d1
  292.     cmp    d0,d1
  293.     blt.s    StepOk
  294.     move    d1,d0
  295.     bra.s    StepOk
  296.  
  297.  
  298.  
  299. NoStep:
  300.     move.b    2(a6),d0
  301.     and.b    #$0f,d0
  302.     cmp.b    #1,d0
  303.     beq    appreggiato
  304.     cmp.b    #2,d0
  305.     beq    pitchbend
  306.     cmp.b    #3,d0
  307.     beq    LedOn
  308.     cmp.b    #4,d0
  309.     beq    LedOff
  310.     cmp.b    #7,d0
  311.     beq.s    SetStepUp
  312.     cmp.b    #8,d0
  313.     beq.s    SetStepDown
  314.     rts
  315.  
  316. LedOn:
  317.     bset    #1,$bfe001
  318.     rts
  319. LedOff:
  320.     bclr    #1,$bfe001
  321.     rts
  322.  
  323. SetStepUp:
  324.     moveq    #0,d4
  325. StepFinder:
  326.     clr    (a4)
  327.     move    (A6),2(a4)
  328.     moveq    #0,d2
  329.     move.b    3(a6),d2
  330.     and    #$0f,d2
  331.     tst    d4
  332.     beq.s    NoNegIt
  333.     neg    d2
  334. NoNegIt:    
  335.     move    d2,(a4)
  336.     moveq    #0,d2
  337.     move.b    3(a6),d2
  338.     lsr    #4,d2
  339.     move    (a6),d0
  340.     lea    NoteTable,a0
  341.  
  342. StepUpFindLoop:
  343.     move    (A0),d1
  344.     cmp    #-1,d1
  345.     beq.s    EndStepUpFind
  346.     cmp    d1,d0
  347.     beq.s    StepUpFound
  348.     addq    #2,a0
  349.     bra.s    StepUpFindLoop
  350. StepUpFound:
  351.     ;move    d2,(a5)+
  352.     lsl    #1,d2
  353.     ;move    d2,(a5)+
  354.     tst    d4
  355.     bne.s    NoNegStep
  356.     neg    d2
  357. NoNegStep:
  358.     ;move    d2,(A5)+
  359.     ;move.l    a0,(A5)+
  360.     move    (a0,d2.w),d0
  361.     move    d0,4(A4)
  362.     rts
  363.  
  364. EndStepUpFind:
  365.     move    d0,4(A4)
  366.     rts
  367.     
  368. SetStepDown:
  369.     st    d4
  370.     bra.s    StepFinder
  371.  
  372.     DSEG
  373.  
  374. StepControl0:
  375.     dc.l    0,0
  376. StepControl1:
  377.     dc.l    0,0
  378. StepControl2:
  379.     dc.l    0,0
  380. StepControl3:
  381.     dc.l    0,0
  382.  
  383.     CSEG
  384.  
  385. appreggiato:
  386.     lea    ArpeTable,a0
  387.     moveq    #0,d0
  388.     move    Timer,d0
  389.     subq    #1,d0
  390.     lsl    #2,d0
  391.     move.l    (A0,d0.l),a0
  392.     jmp    (A0)
  393.  
  394. Arpe4:    lsl.l    #1,d0
  395.     clr.l    d1
  396.     move.w    16(a6),d1
  397.     lea.l    NoteTable,a0
  398. Arpe5:    move.w    (a0,d0.l),d2
  399.     cmp.w    (a0),d1
  400.     beq.s    Arpe6
  401.     addq.l    #2,a0
  402.     bra.s    Arpe5
  403.  
  404.  
  405.  
  406. Arpe1:    clr.l    d0
  407.     move.b    3(a6),d0
  408.     lsr.b    #4,d0
  409.     bra.s    Arpe4
  410.  
  411.  
  412. Arpe2:    clr.l    d0
  413.     move.b    3(a6),d0
  414.     and.b    #$0f,d0
  415.     bra.s    Arpe4
  416.  
  417. Arpe3:    move.w    16(a6),d2
  418.     
  419. Arpe6:    move.w    d2,6(a5)
  420.     rts
  421.  
  422.  
  423. pitchbend:
  424.     clr.l    d0
  425.     move.b    3(a6),d0
  426.     lsr.b    #4,d0
  427.     cmp.b    #0,d0
  428.     beq.s    pitch2
  429.     add.w    d0,(a6)
  430.     move.w    (a6),6(a5)
  431.     rts
  432. pitch2:    clr.l    d0
  433.     move.b    3(a6),d0
  434.     and.b    #$0f,d0
  435.     cmp.b    #0,d0
  436.     beq.s    pitch3
  437.     sub.w    d0,(a6)
  438.     move.w    (a6),6(a5)
  439. pitch3:    rts
  440.  
  441.  
  442.     
  443. ;--------------------------------------------------------------------
  444.  
  445. PlaySound:
  446.     move.l    SongPointer,a0        ;Zeiger auf SongFile
  447.     add    #60,a0            ;Laengentabelle ueberspringen
  448.     move.l    a0,a3
  449.     move.l    a0,a2
  450.     lea    600(A0),a0        ;Zeiger auf BlockDaten
  451.     add    #472,a2            ;zeiger auf Patterntab.
  452.     add    #12,a3            ;zeiger auf Instr.Daten
  453.     move.l    TrackPos,d0        ;Postionzeiger
  454.     clr.l    d1
  455.     move.b    (a2,d0.l),d1        ;dazugehörige PatternNr. holen
  456.     moveq    #10,d7
  457.     lsl.l    d7,d1            ;*1024 / länge eines Pattern
  458.     add.l    PosCounter,d1        ;Offset ins Pattern
  459.     clr.w    DmaCon
  460.     lea    StepControl0,a4
  461.     lea    $dff0a0,a5        ;Zeiger auf Kanal0
  462.     lea    ChannelData0,a6        ;Daten für Kanal0
  463.     moveq    #3,d7            ;4 Kanäle
  464. SoundHandleLoop:
  465.     bsr    PlayNote        ;aktuelle Note spielen
  466.     add.l    #$10,a5            ;nächster Kanal
  467.     add.l    #22,a6            ;nächste Daten
  468.     add    #8,a4
  469.     dbf    d7,SoundHandleLoop    ;4*
  470.     
  471.     move    DmaCon,d0        ;DmaBits
  472.     bset    #15,d0            ;Clear or Set Bit setzen
  473.     move.w    d0,$dff096        ;DMA ein!
  474.  
  475.     move    #300,d0            ;Verzögern (genug für MC68030)
  476. Delay2:
  477.     dbf    d0,Delay2
  478.  
  479.     lea    ChannelData3,a6
  480.     lea    $dff0d0,a5
  481.     moveq    #3,d7
  482. SetRegsLoop:
  483.     move.l    10(A6),(a5)        ;Adresse
  484.     move    14(A6),4(A5)        ;länge
  485. NoSetRegs:
  486.     sub    #22,a6            ;nächste Daten
  487.     sub    #$10,a5            ;nächster Kanal
  488.     dbf    d7,SetRegsLoop
  489.     tst    PlayLock
  490.     beq.s    NoEndPattern
  491.     add.l    #16,PosCounter        ;PatternPos erhöhen
  492.     cmp.l    #1024,PosCounter    ;schon Ende ?
  493.     blt.s    NoEndPattern
  494.  
  495.     clr.l    PosCounter        ;PatternPos löschen
  496.     addq.l    #1,TrackPos        ;Position erhöhen
  497. NoAddPos:
  498.     move.w    AnzPat,d0        ;AnzahlPosition
  499.     move.l    TrackPos,d1        ;Aktuelle Pos
  500.     cmp.w    d0,d1            ;Ende?
  501.     bne.s    NoEndPattern        ;nein!
  502.     clr.l    TrackPos        ;ja/ Sound von vorne
  503. NoEndPattern:
  504.     rts
  505.  
  506.  
  507.  
  508. PlayNote:
  509.     clr.l    (A6)
  510.     tst    PlayLock        ;Player zugelassen ?
  511.     beq.s    NoGetNote        ;
  512.     move.l    (a0,d1.l),(a6)        ;Aktuelle Note holen
  513. NoGetNote:
  514.     addq.l    #4,d1            ;PattenOffset + 4
  515.     clr.l    d2
  516.     cmp    #-3,(A6)        ;Ist Note = 'PIC' ?
  517.     beq    NoInstr2        ;wenn ja -> ignorieren
  518.     move.b    2(a6),d2        ;Instr Nummer holen    
  519.     and.b    #$f0,d2            ;ausmaskieren
  520.     lsr.b    #4,d2            ;ins untere Nibble
  521.     tst.b    d2            ;kein Intrument ?
  522.     beq.s    NoInstr2        ;wenn ja -> überspringen
  523.     
  524.     clr.l    d3
  525.     lea.l    Instruments,a1        ;Instr. Tabelle
  526.     move.l    d2,d4            ;Instrument Nummer
  527.     subq    #1,d2
  528.     lsl    #2,d2            ;Offset auf akt. Instr.
  529.     mulu    #30,d4            ;Offset Auf Instr.Daten
  530.     move.l    (a1,d2.w),4(a6)        ;Zeiger auf akt. Instr.
  531.     move.w    (a3,d4.l),8(a6)        ;Instr.Länge
  532.     move.w    2(a3,d4.l),18(a6)    ;Volume
  533.     move.w    4(a3,d4.l),d3        ;Repeat
  534.     tst    d3            ;kein Repeat?
  535.     beq.s    NoRepeat        ;Nein!
  536.                     ;Doch!
  537.     
  538.     move.l    4(a6),d2        ;akt. Instr.
  539.     add.l    d3,d2            ;Repeat dazu
  540.     move.l    d2,10(a6)        ;Repeat Instr.
  541.     move.w    6(a3,d4),14(a6)        ;rep laenge
  542.     move.w    18(a6),d3         ;Volume in HardReg.
  543.     bra.s    NoInstr
  544.  
  545. NoRepeat:
  546.     move.l    4(a6),d2        ;Instrument    
  547.     add.l    d3,d2            ;rep Offset
  548.     move.l    d2,10(a6)        ;in Rep. Pos.
  549.     move.w    6(a3,d4.l),14(a6)    ;rep Laenge
  550.     move.w    18(a6),d3         ;Volume in Hardware
  551.  
  552. CheckPic:
  553. NoInstr:
  554.     move.b    2(A6),d2
  555.     and    #$0f,d2
  556.     cmp.b    #5,d2
  557.     beq.s    ChangeUpVolume
  558.     cmp.b    #6,d2
  559.     bne.L    SetVolume2
  560.     moveq    #0,d2
  561.     move.b    3(A6),d2
  562.     sub    d2,d3        
  563.     tst    d3
  564.     bpl    SetVolume2    
  565.     clr    d3
  566.     bra.L    SetVolume2
  567. ChangeUpVolume:
  568.     moveq    #0,d2
  569.     move.b    3(A6),d2
  570.     add    d2,d3
  571.     tst    d3
  572.     cmp    #64,d3
  573.     ble.L    SetVolume2
  574.     move    #64,d3
  575. SetVolume2:
  576.     move    d3,8(A5)
  577.     
  578. NoInstr2:
  579.     cmp    #-3,(A6)        ;Ist Note = 'PIC' ?
  580.     bne.s    NoPic        
  581.     clr    2(A6)            ;wenn ja -> Note auf 0 setzen
  582.     bra.s    NoNote    
  583. NoPic:
  584.     tst    (A6)            ;Note ?
  585.     beq.s    NoNote            ;wenn 0 -> nicht spielen
  586.     
  587.     clr    (A4)
  588.     move.w    (a6),16(a6)        ;eintragen
  589.     move.w    20(a6),$dff096        ;dma abschalten
  590.     move.l    d7,-(SP)
  591.     move    #300,d7            ;genug für MC68030
  592. Delay1:
  593.     dbf    d7,Delay1        ;delay
  594.     move.l    (SP)+,d7
  595.     cmp    #-2,(A6)        ;Ist es 'STP'
  596.     bne.s    NoStop            ;Nein!
  597.     clr    8(A5)
  598.     bra    Super
  599. NoStop:
  600.     move.l    4(a6),0(a5)        ;Intrument Adr.
  601.     move.w    8(a6),4(a5)        ;Länge
  602.     move.w    0(a6),6(a5)        ;Period
  603. Super:
  604.     move.w    20(a6),d0        ;DMA Bit
  605.     or.w    d0,DmaCon        ;einodern
  606. NoNote:
  607.     rts
  608.  
  609. ;--------------------------------------------------------------------
  610.  
  611.     DSEG
  612.  
  613. ArpeTable:
  614.     dc.l    Arpe1
  615.     dc.l    Arpe2
  616.     dc.l    Arpe3
  617.     dc.l    Arpe2
  618.     dc.l    Arpe1
  619.  
  620.  
  621. ChannelData0:
  622.     ds.l    5,0            ;Daten für Note
  623.     dc.w    1            ;DMA - Bit
  624. ChannelData1:    
  625.     ds.l    5,0            ;u.s.w
  626.     dc.w    2
  627. ChannelData2:    
  628.     ds.l    5,0            ;etc.
  629.     dc.w    4
  630. ChannelData3:    
  631.     ds.l    5,0            ;a.s.o
  632.     dc.w    8
  633. Instruments:
  634.     ds.l    15,0            ;Zeiger auf die 15 Instrumente
  635. PosCounter:
  636.     dc.l    0            ;Offset ins Pattern
  637. TrackPos:
  638.     dc.l    0            ;Position Counter
  639. Timer:
  640.     dc.w    0            ;Zähler 0-5
  641. DmaCon:
  642.     dc.w    0            ;Zwischenspeicher für DmaCon
  643. AnzPat:
  644.     dc.w    1            ;Anzahl Positions
  645. PlayLock:
  646.     dc.w    0            ;Flag fuer 'Sound erlaubt'
  647. DelayValue:
  648.     dc.w    14565
  649. SongPointer:
  650.     dc.l    0
  651. Lock:
  652.     dc.l    0
  653. SongLaenge:
  654.     dc.l    0
  655. CiaaBase:
  656.     dc.l    0
  657. DosBase:
  658.     dc.l    0
  659. FileInfo:
  660.     dc.l    0
  661.  
  662. InterruptName:
  663.     dc.b    "Chris's SoundInterrupt",0
  664. CiaaResource:
  665.     dc.b    'ciaa.resource',0
  666. DosLib:
  667.     dc.b    'dos.library',0
  668. FileName:
  669.     dc.b    'sound.data',0
  670.     even
  671.     dcb.w    30,1076
  672. NoteTable:
  673.     dc.w    1076,1016,960,906,856,808,762,720,678,640,604,570
  674.     dc.w    538,508,480,453,428,404,381,360,339,320,302,285
  675.     dc.w    269,254,240,226,214,202,190,180,170,160,151,143
  676.     dc.w    135,127,120,113
  677.     dcb.w    30,113
  678.  
  679.